# -*- coding: utf-8 -*-
"""
Created on Thu Nov 19 10:19:47 2015

@author: liliangrong
"""

from sys import argv

script,filename = argv

print "We`re going to erase %r." % filename
print "if you don`t want that,hit CTRL-C (^C)."
print "if you do want that,hit return."

raw_input("?")

print "Opening the file ..."
target = open(filename,'w')

print "Truncating the file. Goodbye!"
target.truncate()

print "Now I`m going to ask you for three lines."

line1 = raw_input("line1:")
line2 = raw_input("line2:")
line3 = raw_input("line3:")

print "I`m going to write these to the file."

target.write(line1)
target.write("\n")
target.write(line2)
target.write("\n")
target.write(line3)
target.write("\n")

print "And finally,we close it."
target.close()